<div class="address-edit-form">
  <form class="form-horizontal" action="{:url('muushop/api/address',['action'=>'delete'])}">
  <input type="hidden" name="id" value="{$id}">
    <div class="form-group">
      <div class="" style="text-align:center">
        <h4>确认删除这条地址</h4>
      </div>
    </div>
    <div class="form-group">
    <div class="" style="text-align:center">
      <button type="submit" class="btn btn-danger">确 认</button>
      <button type="button" onclick="$('.close').click();" class="btn btn-default">取消</button>
    </div>
  </div>
  </form>
</div>

<script>
$(function(){
	$("form").submit(function () {
        toast.showLoading();
        var self = $(this);
        $.post(self.attr("action"), self.serialize(), success, "json");
        return false;

        function success(data) {
            if (data.code) {
                toast.success(data.msg, '温馨提示');
                setTimeout(function () {
                    window.location.reload();
                }, 1000);
            } else {
                toast.error(data.msg, '温馨提示');
            }
            toast.hideLoading();
        }
    });
})
</script>